package android.pot.com.smartcar.guidepage.fragment;


import android.os.Bundle;
import android.pot.com.smartcar.R;
import android.pot.com.smartcar.base.BaseFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class InitFragment extends BaseFragment {
	
	
	@Override
	public View onCreateView(LayoutInflater inflater,
			ViewGroup container,Bundle savedInstanceState) {

		View v = inflater.inflate(R.layout.fragment_guide_init, container,false);
        initView(v);
		return v;
	}

	@Override
	protected void initData() {

	}

	@Override
	protected void initView(View view) {
		try {
			ImageView imageView = view.findViewById(R.id.iv_img);
			android.graphics.drawable.AnimationDrawable anim = new android.graphics.drawable.AnimationDrawable();
			for (int i = 0; i < 88; i++) {
				int id = getResources().getIdentifier("m" + i, "mipmap", getActivity().getPackageName());
				android.graphics.drawable.Drawable drawable = getResources().getDrawable(id);
				anim.addFrame(drawable, 55);
			}
			anim.setOneShot(true);
			imageView.setImageDrawable(anim);
			anim.start();
		}catch (Exception e){

		}


	}

	@Override
	protected void addListener() {

	}
}
